package cn.kgc.blogweb.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;
import java.util.Set;

@FeignClient("count-service")
public interface CountApi {

    @GetMapping("/count")
    public Integer addOneAddress(@RequestParam("newsId")Integer newsId,
                                 @RequestParam("address") String address);

    @GetMapping("/count/{newsId}")
    public Map<Integer, Integer> getAllCounts(@PathVariable("newsId") String newsList);

    @GetMapping("/hot")
    public List<Integer> getHotNews(@RequestParam("newsIdList") List<Integer> newsIdList);

    @GetMapping("/rmzSet")
    public long zSetRemove(@RequestParam("key") String key);

    @PostMapping("/setHotNews")
    public void setHot(@RequestParam("key") String key, @RequestParam("value") String value);

    @GetMapping("/getHotNews")
    public String getHot(@RequestParam("key") String key);
}
